package com.youlu.campus.service.visitor.impl;

import com.youlu.campus.entity.UserPointsCourseStudyDetail;
import com.youlu.campus.service.visitor.UserPointsCourseStudyDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

/**
 * 平台级课程学习任务明细服务实现类
 */
@Service
@Slf4j
public class UserPointsCourseStudyDetailServiceImpl implements UserPointsCourseStudyDetailService {

    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public void create(String userId, String platform, String appId, String orderNo) {
        UserPointsCourseStudyDetail userPointsCourseStudyDetail = new UserPointsCourseStudyDetail();
        userPointsCourseStudyDetail.setUserId(userId);
        userPointsCourseStudyDetail.setAppId(appId);
        userPointsCourseStudyDetail.setPlatform(platform);
        userPointsCourseStudyDetail.setOrderNo(orderNo);
        mongoTemplate.insert(userPointsCourseStudyDetail);
    }
}
